package com.crm.service.impl.sys;

import com.crm.dao.mapper.customMapper.sys.UserInfoCustomMapper;
import com.crm.dao.mapper.sys.UserInfoMapper;
import com.crm.dao.mapper.sys.UserInfoSubordinateMapper;
import com.crm.model.entity.sys.UserInfo;
import com.crm.model.entity.sys.UserInfoExample;
import com.crm.model.entity.sys.UserInfoSubordinate;
import com.crm.model.entity.sys.UserInfoSubordinateExample;
import com.crm.model.vo.user.UserInfoVO;
import com.crm.service.sys.UserInfoDbService;
import com.crm.service.sys.UserInfoSubordinateDbService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author luojie
 * @date 2020/10/9 9:35
 */
@Service
public class UserInfoSubordinateDbServiceImpl implements UserInfoSubordinateDbService {

    @Autowired
    UserInfoSubordinateMapper userInfoSubordinateMapper;

    /**
     * 查询下属表   查询下属的id
     * @param userId 用户id
     * @return
     */
    @Override
    public List<UserInfoSubordinate> subordinateList(String userId) {
        UserInfoSubordinateExample userInfoSubordinateExample = new UserInfoSubordinateExample();
        UserInfoSubordinateExample.Criteria criteria = userInfoSubordinateExample.createCriteria();
        criteria.andUserIdEqualTo(userId);
        List<UserInfoSubordinate> list = userInfoSubordinateMapper.selectByExample(userInfoSubordinateExample);
        return list;
    }
}
